#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("numsum.in" , "r" , stdin);
	freopen("numsum.out" , "w" , stdout);
	char num[210] = {0};
	int sum = 0;
	scanf("%s" , num);
	for(int i = 0 ; i < (int)strlen(num) ; i++){
		int a = num[i] - '0';
		sum = sum + a;
	}
	cout << sum << endl;
	return 0;
}